#pragma once

#include <atlstr.h>
#include "LogDefine.h"
#include "LogManager.h"

namespace Utility
{
    namespace  LoggerLib
    {
        class CLogger
        {
        public:
            CLogger();
            ~CLogger();

            bool Initialize(unsigned long dwLevelMask = ALL_LEVEL, 
                unsigned long dwExecutorMask = FILE_EXECUTOR,
                const wstring& strLogFilePath = DEFAULT_LOGFILE_PATH);
            bool IsInitialized() const {return m_bInitialized;}
            void Terminate();
            
            void SetLogFilePath(const CString &strFilePath);

            void SetLevel(unsigned long dwLevelMask);
            unsigned long GetLevelMask() const;
            
            void SetExecutor(unsigned long dwExecutorMask);
            unsigned long GetExecutorMask() const;
            
            
            int Log(ELOGLEVEL eLevel, ELOGMODULE eModule, const wstring& strLog);
            int Log(ELOGLEVEL eLevel, ELOGMODULE eModule, TCHAR* strFormat, ...);

        private:
            CLogManager   m_LogManager;
            bool  m_bInitialized;
        };
    }
}